<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>table模块快速使用</title>

    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <script src="/static/js/jquery.min.js"></script>

    <script src="/static/layui/layui.js"></script>
    <!-- 注意，wangEditor 只需要引用 JS，无需引用任何 CSS ！！！-->
    <script type="text/javascript" src="/static/wangEditor/wangEditor.min.js"></script>


</head>
<body style="height: 100%;border-top: 10px">
<form class="layui-form" action="" autocomplete="new-password" >
    <input type="hidden" id="id" name="id" value="${model.id}">

    <div class="layui-form-item" >
        <label class="layui-form-label">Phone1</label>
        <div class="layui-input-block" style="padding-left: 10px;padding-right: 10px">
            <input type="text" name="phoneOne"  value="${model.phoneOne}"  lay-verify="required" placeholder="Please enter your contact information"  class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" >
        <label class="layui-form-label">Phone2</label>
        <div class="layui-input-block" style="padding-left: 10px;padding-right: 10px">
            <input type="text" name="phoneTwo"  value="${model.phoneTwo}"  lay-verify="required" placeholder="Please enter your contact information"  class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" >
        <label class="layui-form-label">Email</label>
        <div class="layui-input-block" style="padding-left: 10px;padding-right: 10px">
            <input type="text" name="email"  value="${model.email}"  lay-verify="required" placeholder="Please enter the email"  class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" >
        <label class="layui-form-label">Address</label>
        <div class="layui-input-block" style="padding-left: 10px;padding-right: 10px">
            <input type="text" name="address"  value="${model.address}"  lay-verify="required" placeholder="Please enter the address"  class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button id="btn" class="layui-btn" lay-submit lay-filter="commit">Submit</button>
            <%--<button type="reset" class="layui-btn layui-btn-primary">Reset</button>--%>
        </div>
    </div>
</form>

<%--注意只能在这里引入webuploader_upload.js ，不然点击选择图片按钮不能出现--%>
<script type="text/javascript" src="/static/webuploader/webuploader_upload.js"></script>


<script>
    layui.use(['upload','jquery','form','util','laydate'], function(){
        var $ = layui.jquery
            ,upload = layui.upload
            ,laydate = layui.laydate
            ,form = layui.form;

        //监听提交
        form.on('submit(commit)', function(data){

            $.ajax({
                url : '/manage/basicSet/edit',
                type : 'post',
                dataType : 'json',
                data : data.field,
                success : function (data) {
                    if (data.code==200){
                        layer.msg(data.msg,{icon: 1, time: 500},function () {
                            // layer.close();
                            // window.parent.location.reload();
                        });
                    }else{
                        layer.msg(data.msg,{icon: 2, time: 1000});
                    }
                }
            })
            return false;
        });

    });
</script>



</body>
</html>
